package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.GrogshopRoom;
import cn.wolfcode.trip.base.mapper.GrogshopRoomMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IGrogshopRoomService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IGrogshopRoomServiceImpl implements IGrogshopRoomService {

    @Autowired
    private GrogshopRoomMapper grogshopRoomMapper ;

    @Override
    public void saveOrUpdate(GrogshopRoom grogshopRoom) {
        grogshopRoomMapper.insert(grogshopRoom);
    }

    @Override
    public PageInfo<GrogshopRoom> query(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize(),qo.getOrderBy());
        List<GrogshopRoom> list = grogshopRoomMapper.selectForList(qo);
        return new PageInfo(list);
    }

}
